//
//  ItemCollectionViewCell.m
//  UI12豆瓣大项目
//
//  Created by 李奇 on 15/11/5.
//  Copyright © 2015年 蓝鸥科技. All rights reserved.
//

#import "ItemCollectionViewCell.h"
#import "UIImageView+WebCache.h"

@implementation ItemCollectionViewCell
-(instancetype)initWithFrame:(CGRect)frame{
    if ([super initWithFrame:frame]) {
        
        [self creatSubView];
        
    }
    return self;
}

-(void)creatSubView{

    self.pictureV = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 100, 160)];
    
    [self.contentView addSubview:self.pictureV];
    self.title1 = [[UILabel alloc] initWithFrame:CGRectMake(0, 160, 100, 20)];
    self.title1.userInteractionEnabled = YES;
    self.title1.font = [UIFont systemFontOfSize:12];
    //居中
    self.title1.textAlignment = NSTextAlignmentCenter;
    
    [self.contentView addSubview:self.title1];
    
    [_pictureV release];
    [_title1 release];


}

-(void)setActivity:(Activity *)activity{
    if (_activity != activity) {
        [_activity release];
        _activity = [activity retain];
    }
    [self.pictureV sd_setImageWithURL:[NSURL URLWithString:self.activity.pic_url] placeholderImage:[UIImage imageNamed:@"picholder"]];
    
    self.title1.text = self.activity.movieName;

}
@end
